<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    /*
    promise 是一个构造函数 promise自身的回调函数是同步的
    promise 用来处理异步 解决回调地狱(层层嵌套的回调函数)
    */
    const p1 = new Promise((resolve, reject) => {
      console.log('请求数据');
      setTimeout(() => {
        console.log("请求成功");
      }, 3000)
    })

    console.log('p1:', p1);
  </script>
</body>

</html>